/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cl.alanis.dao;

import cl.alanis.bd.ConectaBD;
import cl.alanis.dao.impl.DocumentoDaoImpl;
import cl.alanis.util.AlanisLog;
import java.sql.SQLException;
import java.util.logging.Level;
import org.apache.log4j.Logger;


/**
 *
 * @author nicolas
 */
public class Dao {
     protected ConectaBD conexion;
     Logger logger=AlanisLog.obtenerLogger(Dao.class);
     public Dao(){
        try {
            this.conexion=ConectaBD.getInstance();
        } catch (ClassNotFoundException ex) {
            logger.error("Error:"+ex.getMessage());
        } catch (InstantiationException ex) {
            logger.error("Error:"+ex.getMessage());
        } catch (IllegalAccessException ex) {
            logger.error("Error:"+ex.getMessage());
        } catch (SQLException ex) {
            logger.error("Error:"+ex.getMessage());
        }
     }
     
     public void commit(){
        try {
            this.conexion.commit();
        } catch (SQLException ex) {
            logger.error("Error:"+ex.getMessage());
        }
     }
     
     public void rollback(){
        try {
            this.conexion.rollback();
        } catch (SQLException ex) {
            logger.error("Error:"+ex.getMessage());
        }
     }
}
